<?php
/**
 *	KLF Framework
 *
 *	Written by Kristian Oye <kristianoye@gmail.com> on Oct 30, 2011
 *	Copyright (C) 2010-2011
 */
namespace KLF\System\Config
{
	/**
	 *  Class KWebApplicationConfiguration
	 *
	 *  Contains a web application configuration.
	 *
	 *  @package KLF\System\Config
	 *  @access public
	 *  @author Kristian Oye <kristianoye@gmail.com>
	 *  @since 0.1
	 *
	 *  @method KWebApplicationConfiguration NewInstance
	 *  
	 *  @property string $BaseDirectory
	 *  @property string $ConfigurationDirectory
	 *  @property boolean $IsInitialized
	 */
	class KWebApplicationConfiguration extends KApplicationConfiguration
	{
		/**
		 * The configuration base directory.
		 * 
		 * @var string $_rpropBaseDirectory
		 */
		protected $_rpropBaseDirectory;
		
		/**
		 * The configuration directory.
		 * 
		 * @var string $_rpropConfigurationDirectory
		 */
		protected $_rpropConfigurationDirectory;
		
		/**
		 * Indicates whether the configuration is fully initialized.
		 * 
		 * @var boolean $_rpropInitialized
		 */
		protected $_rpropIsInitialized;
		
		/**
		 * Constructs a new web application configuration.
		 * 
		 * @param string|array $parm
		 */
		public function __construct($parm)
		{
			$this->_rpropIsInitialized = false;
			parent::__construct($parm);
		}
		
		/**
		 * Returns the content directory.
		 * 
		 * @return string
		 */
		public function GetContentDirectory()
		{
			return $this->GetValue('ContentDirectory');
		}
		
		public function Initialize($baseDir, $configDir)
		{
			if (!$this->_rpropIsInitialized)
			{
				$this->_rpropBaseDirectory = $baseDir;
				$this->_rpropConfigurationDirectory = $configDir;
				$this->_rpropIsInitialized = true;				
			}
		}
	}
}